package com.bsoft.gol.editor.dao;


import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import com.bsoft.gol.editor.editor.ControlReportEntity;

import java.util.List;

/**
 * Created by Sangs on 2020/4/3.
 */
public abstract class ControlReportEntityDAO extends ctd.persistence.support.hibernate.HibernateSupportDelegateDAO<ControlReportEntity> {

    public ControlReportEntityDAO() {
        this.setKeyField("reportId");
    }


    @DAOMethod(sql = "from controlReport where ifSynchro is null or ifSynchro=''  order by answerTime")
    public abstract List<ControlReportEntity> queryControlReportEntityList(@DAOParam(pageLimit = true) int limit);

    @DAOMethod(sql = "update controlReport set ifSynchro= 1 where reportId in:reportIdList ")
    public abstract void updateControlReportEntityList(@DAOParam("reportIdList") List<String> reportIdList);

    @DAOMethod(sql = "from controlReport where userInfoId=:userInfoId and titleId=:titleId and itemId=:itemId")
    public abstract ControlReportEntity getControlReportByUserId(@DAOParam("userInfoId") String userInfoId,@DAOParam("titleId") String titleId,@DAOParam("itemId") String itemId);




}